package com.dmz.workflow.service;

import com.dmz.workflow.req.ListQuery;
import com.dmz.workflow.req.ProcessInstanceReq;
import com.dmz.workflow.res.FormAdviceConguration;
import com.dmz.workflow.vo.ProcessDetailsVo;
import com.echronos.commons.Result;
import com.echronos.system.resp.member.MemberDetailsResp;
import com.echronos.workflow.res.StartProcessRes;
import com.dmz.workflow.vo.TaskListVo;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.runtime.ProcessInstance;

import java.util.List;

public interface ProcessInstanceService {
    /**
     * 查询单一流程实例
     */
    ProcessInstance getProcessInstanceById(String processInstanceId);

    /**
     * 查询单一历史流程实例
     */
    HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId);

    /**
     * 启动流程实例
     */
    Result<StartProcessRes> startProcess(ProcessInstanceReq processInstanceReq);

    /**
     * 删除流程实例
     */
    void deleteProcess(String processInstanceId, boolean cascade, String deleteReason);

    /**
     * 获取流程详情
     */
    ProcessDetailsVo getProcessDetail(String processInstanceId);

    /**
     * 获取个人发起流程列表
     */
    Result<List<TaskListVo>> listStartedByMe(ListQuery queryVo);

    /**
     * 激活流程实例
     */
    void activate(String processInstanceId);

    /**
     * 挂起流程实例
     */
    void suspend(String processInstanceId);

    /**
     * 查询流程相关人员
     *
     * @param processInstanceId 流程实例ID
     * @return 用户详情
     */
    List<MemberDetailsResp> queryProcessInvolvedMembers(String processInstanceId);

    /**
     * 获取流程配置
     */
    FormAdviceConguration queryFormConfiguration(String processInstanceId);
}
